package com.hornsun.data.dbo;

import com.hornsun.util.ObjByteUtil;

import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.InputStream;

/**
 * Created by 编译中... on 2018/7/7.
 */
public class LogoutData {
    public byte[] name = new byte[16];
    public int sign;
    public int token;
    public static LogoutData fromBytesArray(byte[] array) {
        try {
            InputStream stream = new ByteArrayInputStream(array);
            DataInputStream inputStream = new DataInputStream(stream);
            LogoutData logoutData = new LogoutData();
            inputStream.read(logoutData.name, 0, 16);
            logoutData.sign = ObjByteUtil.BytesOrderConv(inputStream.readInt());
            logoutData.token = ObjByteUtil.BytesOrderConv(inputStream.readInt());
            return logoutData;
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
